package com.applink.sell_proof.utilConvertCount;

import java.util.ArrayList;

import com.applink.sell_proof.pojo.GenericObject;


public class GenericCounter {
	
	
	public static String getSumValueFromAnAttribute(ArrayList<GenericObject> genericObjectList, String attributeId ){
		
		double totalValue = 0;
		for(int i=0; i< genericObjectList.size();i++){
			GenericObject genericObject = new GenericObject();
			genericObject = genericObjectList.get(i);
			double value =0;
			try{
				value = Double.valueOf(genericObject.getContentFromObjectMappingName(attributeId));
			}catch (Exception e){
				value =0;
			}
			finally {		
			}
			totalValue +=value;
		}
		return String.valueOf(totalValue);
	}
	
	
/*	public static String countSubmitButton(ArrayList<ControlSpec> controlSpecList) {

		int count = 0;
		
		for(int i=0 ;i < controlSpecList.size();i++){
			ControlSpec controlSpec = new ControlSpec();
			controlSpec = controlSpecList.get(i);
			
			if(controlSpec.getCtrlType().compareToIgnoreCase(Parameter.CONTROL_TYPE_SUBMIT) == 0){
				count++;
			}
		}
		
		return count;
	}*/
}
